package com.yantong.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private RedisTemplate<String,String> template;

    @RequestMapping("/hello")
    public String hello(){
        return "hello ! yantong!";
    }

    @RequestMapping("/redis")
    public String redis(){
        return template.opsForValue().get("name");
    }

}
